package com.lx.test.handle;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lx.test.dao.UserDao;
import com.lx.test.entity.User;

@Controller
@RequestMapping("get/users")
public class GetAllUser {
	
	
	
	   @Autowired
	   private UserDao userDao ;

	    @RequestMapping( method = RequestMethod.GET)
	    public @ResponseBody
	    Map process( ){

	        List<User> users =  userDao.getAllUser() ;

	        HashMap map = new HashMap<String,Object>() ;

	        map.put("user",users) ;

	        return map ;

	    }



}
